#include <bits/stdc++.h>
#define ll long long
using namespace std;

const int Mod=998244353;
int T;ll n;

inline __int128 fsm(__int128 x){
    return x*(x+1)/2;
}

int main(){
    freopen("tree.in","r",stdin);
    freopen("tree.out","w",stdout);
    scanf("%d",&T);
    while(T--){
        scanf("%lld",&n);
        if(n==0){
            puts("2");
            continue;
        }
        ll l=1,r=sqrt(n)*4,ans=0;
        while(l<=r){
            ll mid=l+r>>1;
            __int128 s2=fsm(mid-1)-2*fsm((mid-1)/2)-(mid%2==0)*(mid/2);
            if(s2>=n) r=mid-1,ans=mid; 
            else l=mid+1;
        }
        if(ans%2==0 and n&1) ans++;
        printf("%lld\n",ans);
    }

    // system("pause");
    return 0;
}
/*
3
3
5
6


10
748
343
758
326
880
650
331
358
950
423


*/